package PTA.javaA;

import java.util.Scanner;

public class ex03 {
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String line = sc.nextLine();
            int n = Integer.parseInt(line);
            if(n>=10000&&n<=20000){
                System.out.println(Integer.toString(n,2)+","+Integer.toString(n,8)+","+Integer.toString(n,16));

            }else{
                int sum = 0;
                for(int i=0;i<line.length();i++){
                    int a = line.charAt(i);
                    if(a!='-'){
                        int b=a-'0';
                        sum+=b;
                        System.out.print(b+" ");
                    }
                }
                System.out.println(sum);
            }

        }

    }
}
